<?php

/**
 * becas_aplicables actions.
 *
 * @package    auip
 * @subpackage becas_aplicables
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class becas_aplicablesActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  
  public function executeIndex(sfWebRequest $request)
  {        
        $this->becas = new sfDoctrinePager('Beca', 5);      
      $this->becas->setQuery(Doctrine::getTable('Beca')->createQuery('b')->where('b.registro_activo <> 0')->andWhere( '(b.fecha_fin - CURRENT_DATE) > 0')->addOrderBy('b.fecha_fin ASC') );
        $this->becas->setPage($request->getParameter('pagina', 1));
        $this->becas->init();
  }
  
  public function executeShow(sfWebRequest $request)
  {
    $this->beca = Doctrine_Core::getTable('Beca')->find(array($request->getParameter('id')));       
    $this->forward404Unless($this->beca);    
  }
  
}
